package game;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class LvlFileFilter extends FileFilter {
	protected FileExtension t;

	@Override
	public boolean accept(File f) {
		t = new FileExtension();
	    if (f.isDirectory()) {
	        return true;
	    }
	    String extension = t.getExtension(f);
	    if (extension != null) {
	        if (extension.equals(FileExtension.lvl))
	        		return true;
	    }

	    return false;
	}

	@Override
	public String getDescription() {
		return "Level File (.lvl)";
	}

}
